import Vue from 'vue'
import Router from 'vue-router'
import login from '@/views/login'
import home from '@/views/home'
import welcome from '@/views/welcome/welcome'
import user from '@/views/user/user'
import right from '@/views/rights/right'
import roles from '@/views/rights/roles'
import category from '@/views/category/category'
import goods from '@/views/goods/goods'
import addgood from '@/views/goods/addgood'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(Router)
Vue.use(ElementUI);

export default new Router({
    routes: [{
        path: '/login',
        name: 'login',
        component: login
    }, {
        path: '/',
        name: 'home',
        component: home,
        redirect: 'welcome',
        children: [{
                path: 'welcome',
                name: 'welcome',
                component: welcome,
            },
            {
                path: 'users',
                name: 'user',
                component: user,
            },
            {
                path: 'rights',
                name: 'right',
                component: right,
            },
            {
                path: 'roles',
                name: 'roles',
                component: roles,
            },
            {
                path: 'categories',
                name: 'category',
                component: category,
            },
            {
                path: 'goods',
                name: 'goods',
                component: goods,
            },
            {
                path: 'addgood',
                name: 'addgood',
                component: addgood,
            },
        ]
    }]
})